package cn.edu.hit.education.action;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;

import cn.edu.hit.education.dialog.SeparateCourseDialog;
import cn.edu.hit.education.pojo.Course;
import cn.edu.hit.education.service.ICourseService;
import cn.edu.hit.education.service.IScheduleService;
import cn.edu.hit.education.view.CourseExploreView;
import educationschedule.Activator;
import educationschedule.Application;

public class SpeparateCourseAction extends Action {
	IScheduleService scheduleService = (IScheduleService)Application.applicationContext.getBean("scheduleServiceImpl");
	ICourseService courseService = (ICourseService)Application.applicationContext.getBean("courseServiceImpl");
	private CourseExploreView view;
	private int courseId;
	/**
	 * @wbp.parser.entryPoint
	 */
	public SpeparateCourseAction(CourseExploreView view,int courseId){
		this.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/toolbar/add_course_16px.png"));
		this.setToolTipText("分配课程");
		this.setText("分配课程");
		
		this.view = view;
		this.courseId = courseId;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		Shell parentShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
		SeparateCourseDialog dlg = new SeparateCourseDialog(parentShell,courseId);
		if(IDialogConstants.OK_ID == dlg.open()){
			
		}
		
		
		super.run();
	}
}
